#include <iostream>
#include <memory>

using namespace std;


int main(int argc, char *argv[])
{
    shared_ptr<int> pI1(new int(5));
    shared_ptr<int> pIT(pI1);
    cout << *pI1 << endl;
    cout << *pIT << endl;

    shared_ptr<int> pI2(new int(10));
    pI1.swap(pI2);
    cout << *pI1 << endl;
    cout << *pIT << endl;
    return 0;
}
